<?php

    $para = $_REQUEST;
    //期号查询
	if($para['qishu']){
		$para['期数']=wjStrFilter($para['qishu']);
		if(!ctype_alnum($para['qishu'])) throw new Exception('用户名包含非法字符,请重新输入');
		 $wheres .= " and qishu = {$para['qishu']}";
	}
    //订单号查询
	if($para['betId']){
		$para['betId']=wjStrFilter($para['betId']);
		if(!ctype_alnum($para['betId'])) throw new Exception('用户名包含非法字符,请重新输入');
		 $wheres .= " and codeid = {$para['betId']}";
	}
	// 用户名限制
		if($para['username'] && $para['username']!='用户名'){
			$para['username']=wjStrFilter($para['username']);
			if(!ctype_alnum($para['username'])) throw new Exception('用户名包含非法字符,请重新输入');
			 $wheres .= " and username like '%{$para['username']}%'";
		}
	// 时间限制
	if($_REQUEST['fromTime'] && $_REQUEST['toTime']){
		$fromTime=strtotime($_REQUEST['fromTime']);
		$toTime=strtotime($_REQUEST['toTime'])+24*3600;
		$wheres .="and ordertime between $fromTime and $toTime";
	}elseif($_REQUEST['fromTime']){
		$fromTime=strtotime($_REQUEST['fromTime']);
		$wheres .="and ordertime>=$fromTime";
	}elseif($_REQUEST['toTime']){
		$toTime=strtotime($_REQUEST['toTime'])+24*3600;
		$wheres .="and ordertime<$fromTime";
	}else{
		$wheres .=' and ordertime>'.strtotime('00:00');;
	}
	$sqls="select * from {$this->prename}orderssc where qishu != 'null'";
	/*var_dump($this->getRows("select * from {$this->prename}orderssc where qishu != 'null'"));*/
	$sqls.= $wheres;
	$datas=$this->getPage($sqls, $this->page, $this->pageSize);
	
?>
<article class="module width_full">
<input type="hidden" value="<?=$this->user['username']?>" />
	<header>
		<h3 class="tabs_involved">阿里分分彩
			<div class="submit_link wz">
			<form action="/admin778899.php/countData/ssclucky" target="ajax" call="defaultSearch" dataType="html">
				期号<input type="text" class="alt_btn" name="qishu" style="width:90px;" value="<?=$_REQUEST['actionNo']?>"/>
				单号<input type="text" class="alt_btn" name="betId" style="width:90px;"/>&nbsp;&nbsp;
				会员<input type="text" class="alt_btn" name="username" style="width:90px;"/>&nbsp;&nbsp;
				时间从 <input type="date" class="alt_btn" name="fromTime"/> 到 <input type="date" name="toTime" class="alt_btn"/>&nbsp;&nbsp;
				<input type="submit" value="查找" class="alt_btn">
				<input type="reset" value="重置条件">
			</form>
			</div>
		</h3>
	</header>
	<table class="tablesorter" cellspacing="0">
		<thead>
			<tr>
				<th>编号</th>
				<th>单号</th>
				<th>用户名</th>
				<th>投注时间</th>
				<th>彩种</th>
				<th>玩法</th>
				<th>期号</th>
				<th>倍数</th>
				<th>模式</th>
				<th>投注号码</th>
				<th>投注金额</th>
				<th>中奖金额</th>
				<!-- <th>返点</th>
				<th>操作</th> -->
			</tr>
		</thead>
		<tbody id="nav01">
		   <?php
		      if($datas['data']){
		      	 foreach ($datas['data'] as $key => $value){
		      	 	?>
		      	 	   <tr class="t1">	
                           <td><?=$value['id']?></td>
                           <td><?=$value['codeid']?></td>
                           <td><?=$value['username']?></td>
                           <td><?=date("m-d H:i",$value['ordertime'])?></td>
                           <td>阿里分分彩</td>
                           <td>
		    		      	<?php
		    		      	  if($value['type'] == 1){
		    		      	  	echo "大小";
		    		      	  }elseif($value['type'] == 2){
		    		      	  	echo "单双";
		    		      	  }elseif($value['type'] == 3){
		    		      	  	echo "龙虎";
		    		      	  }else{
		    		      	    echo "直选";
		    		      	  }
		    		      	?>
		    		      </td>
		    		      <td><?=$value['qishu']?></td>
		    		      <td><?=$value['mom']?></td>
		    		      <td>
		    		       	<?php
	    		      	    if($value['ball'] == 0){
	    		      	    	echo "元";
	    		      	    }elseif($value['ball'] == 1){
	    		      	    	echo "角";
	    		      	    }else{
	    		      	    	echo "分";
	    		      	    }
	    		         	?>	
		    		      </td>
		    		      <td>
		    		      <?=$value['class']?>	
		    		      </td>
		    		      <td><?=$value['money']?></td>
		    		      <td>
		    		      	<?php
		    		      	  if($value['kai']!=0){
		    		      	  	if($value['winmoney']){
		    		      	  	  echo $value['winmoney'];
		    		      	  	}else{
		    		      	  	  echo 0;
		    		      	  	}
		    		      	  }else{
		    		      	  	 echo "未开奖";
		    		      	  } 
		    		      	?>	
		    		      	</td>
		      	 	   </tr>
		      	 	<?php
		      	 }
		      }else{
		      	?>
	            <tr>
	            	 <td colspan="9" align="center">暂时没有投注记录。</td>
	            </tr>
	            <?php
		      }
		   ?>   
		</tbody>
	</table>
	<footer>
	<?php
	        $rel=get_class($this).'/ssclucky-{page}?'.http_build_query($_GET,'','&');
		    $this->display('inc/page.php', 0, $datas['total'], $rel, 'betLogSearchPageAction'); 
			/*$this->display('inc/page.php',0,$datas['total'],$this->pageSize, "/admin778899.php/countData/ssclucky-{page}/");*/
	?>
	</footer>
</article>
<script type="text/javascript">  
ghhs("nav01","tr");  
</script>